﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Meqs.Entity
{
    /// <summary>
    /// 样表
    /// </summary>
    [Serializable]
    public class Templates
    {
        private int _rID;
        private int _evalItemID;
        private string _templateName;
        private TemplateStyle _templateStyle;
        private EvalType _evalType;
        private int _templateLevel;

        public Templates()
        {
        }

        public Templates(int rID, int evalItemID, string templateName, TemplateStyle templateStyle, EvalType evalType, int templateLevel)
        {
            _rID = rID;
            _evalItemID = evalItemID;
            _templateName = templateName;
            _templateStyle = templateStyle;
            _evalType = evalType;
            _templateLevel = templateLevel;
        }

        /// <summary>
        /// ID
        /// </summary>
        public int RID
        {
            get { return _rID; }
            set { _rID = value; }
        }

        /// <summary>
        /// 评估项ID
        /// </summary>
        public int EvalItemID
        {
            get { return _evalItemID; }
            set { _evalItemID = value; }
        }

        /// <summary>
        /// 样表名
        /// </summary>
        public string TemplateName
        {
            get { return _templateName; }
            set { _templateName = value; }
        }

        /// <summary>
        /// 样表样式
        /// </summary>
        public TemplateStyle TemplateStyle
        {
            get { return _templateStyle; }
            set { _templateStyle = value; }
        }

        /// <summary>
        /// 评价方式
        /// </summary>
        public EvalType EvalType
        {
            get { return _evalType; }
            set { _evalType = value; }
        }

        /// <summary>
        /// 局级应用扩展
        /// </summary>
        public int TemplateLevel
        {
            get { return _templateLevel; }
            set { _templateLevel = value; }
        }

        public bool Equals(Templates other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._rID == _rID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (Templates)) return false;
            return Equals((Templates) obj);
        }

        public override int GetHashCode()
        {
            return _rID;
        }
    }

    /// <summary>
    /// 样表样式
    /// </summary>
    public enum TemplateStyle
    {
        /// <summary>
        /// 表格样式
        /// </summary>
        TableStyle = 0, 

        /// <summary>
        /// 问卷样式
        /// </summary>
        QuestionailStyle = 1
    }

    /// <summary>
    /// 评价方式
    /// </summary>
    public enum EvalType
    {
        /// <summary>
        /// 教师评
        /// </summary>
        Teacher = 0,

        /// <summary>
        /// 学生评
        /// </summary>
        Student = 1
    }
}
